package org.example.shardiing.config;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;

/**
 * @author linshiqiang
 * @date 2025-06-16 16:25
 * @description
 */
public class ShardingUtils {

    public static int getYear(Long timestamp) {
        Instant instant = Instant.ofEpochMilli(timestamp);
        ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of("UTC"));
        return zonedDateTime.getYear();
    }
}
